package com.minesweeper;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;

public class WinDialog {
    private static WinDialog instance;
    private WinDialog() {}
    public static void show(int elapsedSeconds) {
        if (instance == null) {
            instance = new WinDialog();
        }
        Alert alert = new Alert(AlertType.INFORMATION);
        alert.setTitle("游戏胜利");
        alert.setHeaderText("恭喜你，你赢了！");
        alert.setContentText("你成功避开了所有地雷！用时: " + elapsedSeconds + " 秒");
        alert.showAndWait();
    }
}